home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / emstools.arc / EMMLIB.ARC / EMM16_B.ASM < prev    next >
Assembly Source File  |  1990-02-04  |  5KB  |  88 lines

  1. ;-----------------------------------------------------------------------------;
  2. ;      MODULE NAME:   EMM16_B.ASM                                             ;
  3. ;                                                                             ;
  4. ;    FUNCTION NAME:   set_partial_context                                     ;
  5. ;                                                                             ;
  6. ;      DESCRIPTION:   This function provides a mechanism for restoring the    ;
  7. ;                     mapping context for specific mappable memory regions    ;
  8. ;                     in a system.  Because this function restores only a     ;
  9. ;                     subset of the mapping context (not the entire system's  ;
  10. ;                     mapping context), it uses much less memory for the save ;
  11. ;                     structure and is potentially faster than set_context.   ;
  12. ;                     The function copies the contents of the source          ;
  13. ;                     structure to selected mapping hardware on each          ;
  14. ;                     expanded memory board.  The application passes a        ;
  15. ;                     far pointer to the source structure.                    ;
  16. ;                                                                             ;
  17. ;                     Use this function instead of save_context &             ;
  18. ;                     restore_context if you need to save or restore the      ;
  19. ;                     mapping context but don't want to (or have to) use a    ;
  20. ;                     handle.                                                 ;
  21. ;                                                                             ;
  22. ;           PASSED:   &source_context:                                        ;
  23. ;                        is a far pointer to the source structure of the      ;
  24. ;                        mapping context to be restored.                      ;
  25. ;                        The structure member is described here:              ;
  26. ;                                                                             ;
  27. ;                        source_context.reserved:                             ;
  28. ;                           is a character array which is reserved for use by ;
  29. ;                           the memory manager.  In this instance it contains ;
  30. ;                           the data for the mapping hardware state.          ;
  31. ;                                                                             ;
  32. ;         RETURNED:   status:                                                 ;
  33. ;                        is the status EMM returns from the call.  All other  ;
  34. ;                        returned results are valid only if the status        ;
  35. ;                        returned is zero.  Otherwise they are undefined.     ;
  36. ;                                                                             ;
  37. ; C USE CONVENTION:   unsigned int   status;                                  ;
  38. ;                     CONTEXT_STRUCT source_context;                          ;
  39. ;                                                                             ;
  40. ;                     status = set_partial_context (&source_context);         ;
  41. ;-----------------------------------------------------------------------------;
  42. .XLIST
  43. PAGE    60,132
  44.  
  45. IFDEF SMALL
  46.    .MODEL SMALL, C
  47. ENDIF
  48. IFDEF MEDIUM
  49.    .MODEL MEDIUM, C
  50. ENDIF
  51. IFDEF LARGE
  52.    .MODEL LARGE, C
  53. ENDIF
  54. IFDEF COMPACT
  55.    .MODEL COMPACT, C
  56. ENDIF
  57. IFDEF HUGE
  58.    .MODEL HUGE, C
  59. ENDIF
  60.  
  61. INCLUDE emmlib.equ
  62. INCLUDE emmlib.str
  63. INCLUDE emmlib.mac
  64. .LIST
  65. .CODE
  66.  
  67. set_partial_context    PROC                                                  \
  68.             USES DS SI,                                           \
  69.             ptr_context:FAR PTR BYTE
  70.  
  71.     ;---------------------------------------------------------------------;
  72.     ;   do;                                                               ;
  73.     ;   .   set the partial mapping context from the app to EMM;          ;
  74.     ;---------------------------------------------------------------------;
  75.     MOVE        AX, set_partial_page_map_fcn
  76.     MOVE        DS:SI, ptr_context
  77.     INT         EMM_int
  78.  
  79.     ;---------------------------------------------------------------------;
  80.     ;   .   return (EMM status);                                          ;
  81.     ;   end;                                                              ;
  82.     ;---------------------------------------------------------------------;
  83.     RET_EMM_STAT    AH
  84.  
  85. set_partial_context    ENDP
  86.  
  87. END
  88.